<%@ include file="/inc/charset.jsp" %>
<%@ page import="java.util.*" %>
<%@ page import="com.synchrobit.synchroflow.api.web.*" %>
<%@ page import="com.synchrobit.synchroflow.api.util.*" %>
<%@ page import="com.synchrobit.synchroflow.api.client.*" %>
<%@ page import="com.synchrobit.synchroflow.enactmentservice.processmonitor.*" %>
<%@ page import="com.synchroflow.common.*"  %>
<%@ page import="com.synchroflow.login.LoginUser"  %>
<%@ page import="com.synchroflow.frame.admin.ModulModel"  %>
<%@ page import="com.synchrobit.synchroflow.api.util.RMIManager"  %>
<jsp:useBean id="displayTableBean" scope="session" class="com.synchrobit.synchroflow.api.web.DisplayTableBean" />
	
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> 
<html>
<head>
<title>
</title>

<link rel="stylesheet" type="text/css" href="<%=path%>/css/newPage.css">
<Script language="javascript" SRC="./style/common.js"></Script>

</head>
<body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0>
			<table width="102%" cellpadding="0" cellspacing="0" border="0">
			<tr height="25"><td background="<%=path%>/images/top01.gif"></td></tr>
			</table>
 			<br>
			
			<table width="95%" align="center" cellpadding="0" cellspacing="0">
		  	<tr>
		    <td>	
		    </td>
		  	</tr>
		  	<tr height="15">
		    <td background="<%=path%>/images/line01.gif">
		    </td>
		  	</tr>
        	</table>
<%
//  ReadXmlConfig confg=ReadXmlConfig.getInstance();
//  String enactmentAPI =confg.getMonitorrimi();
	ProcessMonitor pm= RMIManager.getInstance().getPmRmiConnection();	

//  ProcessMonitor pm=MonitorConnection.getProcessMonitor(enactmentAPI);
 
  Object otemp[][]=pm.getProcessInsList("state<4 and state!=1 ","","processInsId desc");
  String processInsData[][]=StringTools.convert(otemp);
  if (processInsData==null || processInsData.length==0) {
%>
<div align="center">
<br>
<%=I18NTools.getString("com.synchroflow.frame.resource","processView_title")%>
</div>
</body>
</html>
<%
  return;
  }

  String[][] dispData=new String[processInsData.length][6];
  for(int i=0;i<processInsData.length;i++){
    dispData[i][0]= processInsData[i][0];
    dispData[i][1]= "<a target='_blank' href='OaViewWorkItemHis.jsp?processInsId="+processInsData[i][2]+"'>"+processInsData[i][1]+"</a>";
    dispData[i][2]= processInsData[i][3];
    dispData[i][3]= processInsData[i][5];
    dispData[i][4]= processInsData[i][7];
 	dispData[i][5]= "<a target='_blank' href='OaProcessInsDyView_jpg.jsp?processInsId="+processInsData[i][2]+"'><img src='"+path+"/images/view.gif' style='border:none'></a>";
  }
 
  String[][] dispHeader={{I18NTools.getString("com.synchroflow.frame.resource","processView_p"),
  I18NTools.getString("com.synchroflow.frame.resource","processView_name"),
  I18NTools.getString("com.synchroflow.frame.resource","processView_start"),
  I18NTools.getString("com.synchroflow.frame.resource","processView_men"),
  I18NTools.getString("com.synchroflow.frame.resource","processView_de"),
  I18NTools.getString("com.synchroflow.frame.resource","processView_view")},
  {"nowrap align='center' class='tableListHeader'"},{"nowrap align='left' class='tableListContent1'","nowrap align='left' class='tableListContent1'","nowrap align='left' class='tableListContent1'"}};
  String tableStyle="width=\"95%\" align=\"center\" cellspacing=\"1\" class='tableList'";
  String tableButtonStyle="width=\"95%\" align=\"center\" class='standardTable'";
  displayTableBean.setMessageLink(true);
  displayTableBean.setSetButton(true);
  displayTableBean.setTurnButton(true);
  displayTableBean.setSetButtonImg(path+"/images/set.gif");
  displayTableBean.setSetButtonImgOn(path+"/images/set.gif");
  displayTableBean.setTrunButtonImg(path+"/images/turn.gif");
  displayTableBean.setTrunButtonImgOn(path+"/images/turn.gif");
  displayTableBean.setMouseColor("#dddddd");
  displayTableBean.setStartImg(path+"/images/01.gif");
  displayTableBean.setPreImg(path+"/images/02.gif");
  displayTableBean.setNextImg(path+"/images/03.gif");
  displayTableBean.setEndImg(path+"/images/04.gif");
  displayTableBean.setTrStyle("#efefef","#efefef");

%>

<div align="center">
  <form name="myForm" method="post" action="">

  <table width="95%" height="3" align="center" cellpadding="0" cellspacing="0">
			<tr>
			<td background="<%=path%>/images/bkcolor.gif"></td>
			</tr>
  </table>
  <%

    out.println(displayTableBean.displayTable(request,dispData,dispHeader,10,
      tableStyle,tableButtonStyle,"OaProcessInsView.jsp","&"+request.getQueryString(),"myForm"));
  %>
		<br>
			<table width="95%" align="center" cellpadding="0" cellspacing="0">
		  	<tr height="15">
		    <td background="<%=path%>/images/line02.gif">
		    </td>
		  	</tr>
        	</table>
		<br>
  </form>
</div>
</body>
</html>
